<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Document</title>
</head>
<body>

  <div id='app'>
    <home></home>
  </div>

<script src='https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js'></script>
<script>
  const Child = {
    template: `
      <div>
        <header>公共头部</header>
        <slot></slot>
        <footer>公共底部</footer>
      </div>
    `
  }

  const Home = {
    template: `
      <div>
        <h2>父组件</h2>
        <child>
          <div>
            <button>按钮</button>
            <p>内容</p>
          </div>
        </child>
      </div>
    `
    ,components: {
      Child
    }
  }
  Vue.component('Home', Home);
  const app = new Vue({
    el: '#app'
    ,data: {
      msg: 'Hello Vue'
    }
    ,methods: {

    }
  })
</script>
</body>
</html>